package com.property.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@EnableJpaRepositories(basePackages = "com.property.demo.repository")
@ComponentScan(basePackages = "com.property.demo")
public class PropertyManagementApplication {

    private static final Logger logger = LoggerFactory.getLogger(PropertyManagementApplication.class);

    public static void main(String[] args) {
        // 设置系统属性，增加缓冲区大小
        System.setProperty("spring.codec.max-in-memory-size", "10MB");
        System.setProperty("server.tomcat.max-http-header-size", "10MB");
        System.setProperty("server.max-http-header-size", "10MB");

        logger.info("正在启动物业管理系统...");
        logger.info("已配置增加的缓冲区大小和请求处理能力");

        SpringApplication.run(PropertyManagementApplication.class, args);

        logger.info("物业管理系统启动完成");
    }

}
